namespace('org.mediaconverter');

org.mediaconverter.main = Class.extend({
	
	/**
	 * Constructor
	 */
	init: function() {
	
		//init desktop
		this.desktop = new org.mediaconverter.desktop();
		
		//init events
		this.initEvents();
		
	},
	
	/**
	 * Init events
	 */
	initEvents: function() {
		
		$(document.body).on('click', 'a.openInOverlay', $.proxy(function(ev) {
			ev.preventDefault();
			var $link = $(ev.currentTarget);
			var overlay = new org.mediaconverter.overlay($link.attr('href'), $link.attr('data-overlay-height'), $link.attr('data-overlay-width'));
		}, this));
		
		$(document.body).on('click', 'a.openInUserPanel', $.proxy(function(ev) {
			ev.preventDefault();
			$.ajax({
				url: $(ev.currentTarget).attr('href'),
				success: $.proxy(function(res) {
					$('#user_panel').html(res);
				}, this)
			})
		}, this));
		
	}
	
});

$(function() {
	var mediaconverter = new org.mediaconverter.main();
});